home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 2
/
Merciful - Disc 2.iso
/
software
/
s
/
supremov3.00a1.dms
/
supremov3.00a1.adf
/
S
/
Make_DB_q_pc.sm
< prev
next >
Wrap
Text File
|
1992-04-01
|
2KB
|
54 lines
/*******************************************************************************
*
* Make_DB.sm Copyright (c) 7.04.1995, K. Wojcieszek
*
* Program uruchomiony pod SuperMemo v3.0 (lub nowszym) dopisuje
* teksty pytaï i odpowiedzi do aktualnie otwartej bazy w SuperMemo
* (najczëôciej jest to baza pusta) z edytora AmiTekst PRO (AmiTekst_port),
* lub innego wyposaûonego w port Arexx-a.
*
* Wersja 2.00
*
*******************************************************************************/
OPTIONS RESULTS
ADDRESS 'rexx_sm'
CR = '0A'X /* CR - znak koïca linii */
sm_to_add /* Przejdú w tryb dodawania */
ADDRESS 'AmiTekst_port' STATUS NumLines
NumLines = RESULT /* NumLines - liczba linii tekstu */
l = 1; question = ''; answer = ''; rep = ''
DO while (l <= NumLines)
ADDRESS 'AmiTekst_port' JumpToLine l /* Ustaw kursor w linii: l */
ADDRESS 'AmiTekst_port' BegOfLine /* Ustaw kursor na poczâtku linii */
ADDRESS 'AmiTekst_port' STATUS LineBuffer
line = RESULT /* Pobierz zawartoôê aktualnej linii */
l = l + 1
if substr(line, 1, 2) = 'Q:' then /* Formatowanie pytania */
question = question || delstr(line, 1, 3)
else
if substr(line, 1, 2) = 'A:' then /* Formatowanie odpowiedzi */
answer = answer || delstr(line, 1, 3)
else
if substr(line, 1, 2) = 'I:' then /* Formatowanie odpowiedzi */
rep = delstr(line, 1, 3)
else
if line = CR then /* Jednostka kompletna */
DO
sm_PC_AMI question
question = RESULT /* Pobierz zawartoôê aktualnej linii */
sm_put_q question
sm_put_a answer
if rep ~= '' then sm_put_rep rep
sm_write /* Zapis do bazy */
if RESULT = 'RESULT' then LEAVE
question = ''; answer = ''; rep = ''
END
END
sm_to_end /* Zamknij okno dodawania */